
'''Stpe1: read data '''


def read_dict(filename):
    y = dict()
    fwords = open(filename,'r')

    total_list = []

    for word in fwords:
        word  = word.rstrip()
        word_list = word.split(' ')
        total_list.extend(word_list)


    y = dict.fromkeys(total_list)
    return y


def is_in_dict(x, y):
    if x in y:
        return True
    else:
        return False

if __name__ == '__main__':
    # txtname = '/persistence_data/words.txt'
    txtname = '../words.txt'
    text_a = read_dict(txtname)


